<% layout('/layouts/default.html', {title: '回购列表', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('回购列表')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${ztRecovery}" action="${ctx}/ztRecovery/listData" method="post" class="form-inline hide"

					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
												
				<div class="form-group">
					<label class="control-label">${text('回购物品类别')}：</label>
					<div class="control-inline width-90">
						<#form:select name="ztGoodsType.id" items="${typeList}"
							itemLabel="name" itemValue="id" blankOption="true" class="form-control"/>
					</div>
				</div>
				
				
				

				<div class="form-group">

					<label class="control-label">${text('回购物品名')}：</label>

					<div class="control-inline">

						<#form:input path="title" maxlength="200" class="form-control width-120"/>

					</div>

				</div>

				<div class="form-group">

					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>

					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>

				</div>

			</#form:form>

			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>

// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [     
		{header:'${text('订单号')}', name:'code', index:'a.code', width:220, align:"center"},
		{header:'${text('回购物品名')}', name:'title', index:'a.title', width:150, align:"center"},
		
		{header:'${text('价格')}', name:'price', index:'a.price', width:150, align:"center"},
		
		{header:'${text('估价')}', name:'gjprice', index:'a.gjprice', width:150, align:"center"},
		
		{header:'${text('物品类型')}', name:'ztGoodsType.name', index:'z.name', width:100, align:"center"},
		
		{header:'${text('物品图片')}', name:'imgs', index:'a.imgs', width:250, align:"center", formatter: function(val, obj, row, act){
			
			var imgsArr=val.split("&*&");	
			var imr="";
			 for ( var i = 0; i <imgsArr.length; i++){
				   
				   imr+='<img style="width:40px;height:40px;" src="'+imgsArr[i]+'"></img>&nbsp;';
				}
				
			
			return imr;
		}},		
		
		
		{header:'${text('订单状态')}', name:'codestatus', index:'a.codestatus', width:90, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('zt_recovery_type')}, val, '${text('待估价')}', true);
		}},
		
		{header:'${text('创建时间')}', name:'createDate', index:'a.create_date', width:190, align:"center"},
		
		
		{header:'${text('操作')}', name:'actions', width:100,align:"center", sortable:false, title:false, formatter: function(val, obj, row, act){	
			return '<a href="${ctx}/ztRecovery/form?id='+row.id+'" class="btnList" title="${text('查看')}">查看</a>&nbsp;&nbsp;<a href="${ctx}/ztRecovery/gjForm?id='+row.id+'" class="btnList" title="${text('进入估价')}">估价</a>';
		}}
		
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>